<!--
- File:    退款详情页.
-->
<template>
  <div>
    <div class="apply_li mt20">
      <ul>
        <li>退款状态：<span class="cr_41a536">{{refundInfo.seller_state | refundStatusName}}</span></li>
        <li>退款类型：原路退款</li>
        <li>退款编号： {{refundInfo.refund_sn}}</li>
        <li>退款原因： {{refundInfo.reason_info}}</li>
        <!--<li v-if="refundInfo.order_info.goods_integral && refundInfo.order_info.goods_integral > 0">退款合计： <span class="cr_f60202">{{refundInfo.order_info.goods_integral}}</span> 积分</li>-->
        <li>退款金额合计： ¥{{refundInfo.refund_amount}}</li>
        <li><div class=" f26">其中 在线退款:￥{{refundInfo.pay_amount || 0}}&nbsp;&nbsp;&nbsp;&nbsp;积分退还:{{parseInt(refundInfo.integral_amount || 0)}}积分&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
        <!--<li>退款数量： {{refundInfo.goods_num}}</li>-->
        <li>退款说明： {{refundInfo.buyer_message}}</li>
        <li>商家备注： {{refundInfo.seller_message}}</li>
      </ul>
    </div>
    <div class="apply_sel2 p20">
      <button @click="goBack">返回上一页</button>
    </div>
  </div>
</template>

<script>
  import * as dictionary from '../../../dictionary'
  export default{
    data() {
      return {
        returnId: this.$route.params.id,
        refundInfo: {}
      }
    },
    components: {},
    created() {
      this.getRefundInfo(this.returnId)
    },
    filters: {
      refundStatusName: function (value) {
        let name = ''
        switch (value) {
          case dictionary.refundStatus.waiting:
            name = '等待审核'
            break
          case dictionary.refundStatus.resolve:
            name = '卖家已同意'
            break
          case dictionary.refundStatus.reject:
            name = '卖家已拒绝'
            break
        }
        return name
      }
    },
    methods: {
      goBack() {
        this.$router.go(-1)
      },
      getRefundInfo(id) {
        this.$request.getRefundInfo(id).then(data => {
          this.refundInfo = data
        })
      }
    }
  }
</script>

<style>

</style>